package me.w70.fps.render;

public class Scaler {
	
	void ScaleLine(int target, int source, int SrcWidth, int TgtWidth) {
		int NumPixels = TgtWidth;
		int IntPart = SrcWidth / TgtWidth;
		int FractPart = SrcWidth % TgtWidth;
		int E = 0;

		while (NumPixels-- > 0) {
			target++;
			target = source;
			source += IntPart;
			E += FractPart;
			if (E >= TgtWidth) {
				E -= TgtWidth;
				source++;
			} /* if */
		} /* while */
	}
}
